<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="zh">
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>发现</title>

<!--<link rel="stylesheet" href="http://local.res.layui.com/layui/src/css/layui.css">-->
  <link rel="stylesheet" href="../../../layui.css" media="all">
  <script src="../../../../layui.js" ></script>
  <script src="../../../../jquery.min.js"></script>
  <script src="../../../../../js/path.js"></script>
  <style>
    .layim-msgbox{margin: 15px;}
    .layim-msgbox li{position: relative; margin-bottom: 10px; padding: 0 130px 10px 60px; padding-bottom: 10px; line-height: 22px; border-bottom: 1px dotted #e2e2e2;}
    .layim-msgbox .layim-msgbox-tips{margin: 0; padding: 10px 0; border: none; text-align: center; color: #999;}
    .layim-msgbox .layim-msgbox-system{padding: 0 10px 10px 10px;}
    .layim-msgbox li p span{padding-left: 5px; color: #999;}
    .layim-msgbox li p em{font-style: normal; color: #FF5722;}

    .layim-msgbox-avatar{position: absolute; left: 0; top: 0; width: 50px; height: 50px;}
    .layim-msgbox-user{padding-top: 5px;}
    .layim-msgbox-content{margin-top: 3px;}
    .layim-msgbox .layui-btn-small{padding: 0 15px; margin-left: 5px;}
    .layim-msgbox-btn{position: absolute; right: 0; top: 12px; color: #999;}
  </style>
</head>
<body>

<div class="layui-form-item">
  <label class="layui-form-label">选择分组<span style="color: red">*</span></label>
  <div class="layui-input-block" >
    <select id="type" name="type" style="height: 35px">
      <option value>请选择分组</option>
      <option value="0">好友</option>
      <option value="1">群</option>
    </select>
  </div>
</div>
<div class="layui-form-item">
  <label class="layui-form-label">附加消息<span style="color: red;">*</span></label>
  <div class="layui-input-block">
    <textarea id="content" placeholder="请输入附加消息" class="layui-textarea"></textarea>
  </div>
</div>
    <!--  <blockquote class="layui-elem-quote">此为自定义的【查找】页面，因需求不一，所以官方暂不提供该模版结构与样式，实际使用时，可移至该文件到你的项目中，对页面自行把控。-->
<!--  <br>文件所在目录（相对于layui.js）：/css/modules/layim/html/find.html</blockquote>-->
<script>

  $(function () {
      $.post(baseUrl+"user/getGroup",{userid:localStorage.getItem("userid")},function (res) {
          $("#type").empty();
          $("#type").append("<option value>请选择分组</option>")
          var data = res.data;
          $.each(data,function(index,value){
              $("#type").append("<option value="+value['id']+">"+value['groupname']+"</option>")
          })
      },"json");

      $("#type").change(function () {
          localStorage.setItem("groupid",$("#type").val())
      })

      $("#content").change(function () {
          localStorage.setItem("content",$("#content").val())
      })
  })

layui.use(['layim', 'laypage','element'], function() {
    var layim = layui.layim
        , layer = layui.layer
        , laytpl = layui.laytpl
        , $ = layui.jquery
        , laypage = layui.laypage
        , element = layui.element; //Tab的切换功能，切换事件监听等，需要依赖element模块
    //触发事件

})
  function GetRequest() {
      var url = location.search; //获取url中"?"符后的字串
      var theRequest = new Object();
      if (url.indexOf("?") != -1) {
          var str = url.substr(1);
          strs = str.split("&");
          for (var i = 0; i < strs.length; i++) {
              theRequest[strs[i].split("=")[0]] = decodeURIComponent(strs[i].split("=")[1]);
          }
      }
      return theRequest;
  }

//function close() {
//    alert("Asd")
//}
</script>
</body>
</html>
